-- 下行代码只代表查值时自动查global,增加global的变量或者修改global的变量时还是需要带"GLOBAL."
GLOBAL.setmetatable(env, { __index = function(t, k) return GLOBAL.rawget(GLOBAL, k) end })
GLOBAL.ASSASSINAPI = env

-- ※标注的地方大概率在新增内容的时候需要添加对应的参数,请仔细核对※标注的部分

-- 获取mod配置,放到官方的全局变量tuning表中
TUNING.ASSN_LANGUAGE = GetModConfigData("languages")           -- 获取配置:语言
TUNING.ASSN_DIFFICULTY = GetModConfigData("difficulty")        -- 获取配置:魔刀千刃制作难度
TUNING.ASSN_JIANDAO = GetModConfigData("assn_jiandao")         -- 获取配置:剪刀切换攻击模式快捷键
TUNING.ASSN_SKILL1 = GetModConfigData("assn_skill1")           -- 获取配置:范围吸血斩快捷键
TUNING.ASSN_SKILL2 = GetModConfigData("assn_skill2")           -- 获取配置:真实之怒快捷键
TUNING.ASSN_SKILL3 = GetModConfigData("assn_skill3")           -- 获取配置:超巨大化快捷键
TUNING.ASSN_SKILL3_TIME = GetModConfigData("assn_skill3_time") -- 获取配置:超巨大化技能持续时间

require("tuning_assn")                                         -- 全局表

-- ※预制物表
PrefabFiles = {
    "assn_jiandao",      -- 剪刀
    "assn_qianren",      -- 魔刀千刃
    "assn_567",          -- 刺客567
    "assn_skins",        -- 皮肤
    "assn_forcefieldfx", -- 魔刀千刃防护盾
    "assn_suipian",      -- 魔刀千刃碎片
}

-- 资源表
Assets = {
    Asset("ATLAS", "images/assn_inventoryimages.xml"), -- 物品栏贴图集
    Asset("IMAGE", "images/assn_inventoryimages.tex"),
    Asset("ATLAS_BUILD", "images/assn_inventoryimages.xml", 256),

    Asset("IMAGE", "bigportraits/assn_567.tex"), -- 人物立绘
    Asset("ATLAS", "bigportraits/assn_567.xml"),

    Asset("IMAGE", "images/saveslot_portraits/assn_567.tex"), -- 存档图片
    Asset("ATLAS", "images/saveslot_portraits/assn_567.xml"),

    Asset("IMAGE", "images/avatars/avatar_assn_567.tex"), -- tab键人物列表显示的头像
    Asset("ATLAS", "images/avatars/avatar_assn_567.xml"),

    Asset("IMAGE", "images/avatars/avatar_ghost_assn_567.tex"), --tab键人物列表显示的头像(幽灵)
    Asset("ATLAS", "images/avatars/avatar_ghost_assn_567.xml"),

    Asset("IMAGE", "images/avatars/self_inspect_assn_567.tex"), -- 人物物品栏右侧检查图像
    Asset("ATLAS", "images/avatars/self_inspect_assn_567.xml"),

    Asset("IMAGE", "images/selectscreen_portraits/assn_567.tex"), -- 选人界面
    Asset("ATLAS", "images/selectscreen_portraits/assn_567.xml"),

    Asset("IMAGE", "images/selectscreen_portraits/assn_567_silho.tex"), -- 选人界面(未解锁)
    Asset("ATLAS", "images/selectscreen_portraits/assn_567_silho.xml"),

    Asset("IMAGE", "images/map_icons/assn_567.tex"), -- 小地图图标
    Asset("ATLAS", "images/map_icons/assn_567.xml"),

    Asset("IMAGE", "images/names_assn_567.tex"), -- 人物名字(灰色)
    Asset("ATLAS", "images/names_assn_567.xml"),

    Asset("IMAGE", "images/names_gold_assn_567.tex"), -- 人物名字(金色)
    Asset("ATLAS", "images/names_gold_assn_567.xml"),
}

modimport("scripts/assn_linkmod.lua") -- 判定别的mod是否开启

local skin_modes = {
    {
        type = "ghost_skin",
        anim_bank = "ghost",
        idle_anim = "idle",
        scale = 0.75,
        offset = { 0, -25 }
    },
}
-- 增加人物到mod人物列表 性别为男性(MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL)
AddModCharacter("assn_567", "MALE", skin_modes)

-- 注册小地图图标
AddMinimapAtlas("images/assn_inventoryimages.xml")
AddMinimapAtlas("images/map_icons/assn_567.xml")

-- 组件本地
AddReplicableComponent("expbooster")
AddReplicableComponent("stamina")

-- 注册贴图
modimport("scripts/assn_tool.lua")
ASSN_TOOL.Tool_RegisterInventoryItemAtlas("images/assn_inventoryimages.xml")

modimport("scripts/assn_skinapi.lua") -- 风铃的皮肤API
modimport("scripts/assn_actions.lua") -- 动作
modimport("scripts/assn_recipe.lua")  -- ※制作配方
modimport("scripts/assn_hook.lua")    -- 钩子
modimport("scripts/assn_rpc.lua")     -- 主客机交互
modimport("scripts/assn_sg.lua")      -- sg状态机

-- 设置语言(请放在最后)
if TUNING.ASSN_LANGUAGE == "Chinese" then
    modimport("scripts/languages/assn_chinese.lua") -- ※中文
elseif TUNING.ASSN_LANGUAGE == "English" then
    modimport("scripts/languages/assn_english.lua") -- ※英文
else
    modimport("scripts/languages/assn_chinese.lua")
end
